package top.blackr.folivora.common.notification;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author BlackR
 */
@Data
@Component
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "folivora.notification")
public class NotificationProperties {

    /**
     * 钉钉机器人
     * <a href="https://open.dingtalk.com/document/group/custom-robot-access">开发文档</a>
     */
    private DingTalkReboot dingTalkReboot;
    /**
     * 微信机器人 <a href="https://developer.work.weixin.qq.com/document/path/91770">开发文档</a>
     */
    private WeChartReboot weChartReboot;
    /**
     * 邮箱 <a href="https://www.hutool.cn/docs/#/extra/%E9%82%AE%E4%BB%B6%E5%B7%A5%E5%85%B7-MailUtil">开发文档</a>
     */
    private Email email;


    @Data
    @Component
    @ConfigurationProperties(prefix = "folivora.notification.ding-talk-reboot")
    public static class DingTalkReboot {
        private String webhook;
    }

    @Data
    @Component
    @ConfigurationProperties(prefix = "folivora.notification.we-chart-reboot")
    public static class WeChartReboot {
        private String webhook;
    }

    @Data
    @Component
    @ConfigurationProperties(prefix = "folivora.notification.email")
    public static class Email {
        private String host;
        private Integer port;
        private String from;
        private String user;
        private String pass;
    }

}